<?php
namespace app\admin\validate;

use think\Validate;

class Finance extends Validate
{
    protected $rule = [
        'number'  => 'require|unique:finance',
        'type'    => 'require',
        'receive' => 'require',
        'status'  => 'require|in:0,1,2',
    ];

    protected $message = [
        'number'   => '{%number_val}',
        'type'     => '{%type_val}',
        'receive'  => '{%receive_val}',
        'status'   => '{%status_val}',
    ];

    protected $scene = [
        'add'   => ['number', 'type', 'receive', 'status'],
        'edit'  => ['number', 'type', 'receive', 'status'],
        'status' => ['status'],
    ];
}